package com.zd.core.security.service;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.SecurityConfig;
import org.springframework.security.web.FilterInvocation;
import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;

public class InvocationSecurityMetadataSource implements FilterInvocationSecurityMetadataSource {
	
//	private UrlMatcher urlMatcher = new AntUrlPathMatcher();
//	private static Map<String, Collection<ConfigAttribute>> resourceMap = null;
	
	public InvocationSecurityMetadataSource() {
//		resourceMap = new HashMap<String, Collection<ConfigAttribute>>();   
//		Collection<ConfigAttribute> atts = new ArrayList<ConfigAttribute>();   
//		ConfigAttribute ca = new SecurityConfig("ROLE_ADMIN");   
//		atts.add(ca);   
//		resourceMap.put("/index.jsp", atts);   
//		resourceMap.put("/i.jsp", atts);   

	}

	@Override
	public Collection<ConfigAttribute> getAllConfigAttributes() {
		// TODO Auto-generated method stub
		return new ArrayList();
	}

	@Override
	public Collection<ConfigAttribute> getAttributes(Object arg0)
			throws IllegalArgumentException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean supports(Class<?> clazz) {
		//isAssignableFrom判断一个类Class1和另一个类Class2是否相同或是另一个类的超类或接口
		return FilterInvocation.class.isAssignableFrom(clazz);
	}

}
